﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FieldNS;
using robotNS;

namespace Robot_1
{
    public class Position
    {
        int _x = 10;
        int _y = 20;
        public int X
        {
            get { return _x; }
            set { if (value >= 1 && value < ConsoleKeyExample.FieldWidth - 1) _x = value; }
        }
        public int Y
        {
            get { return _y; }
            set { if (value >= 1 && value < ConsoleKeyExample.FieldHeght - 1) _y = value; }
        }
        public Position(int x, int y)
        {
            _x = x;
            _y = y;
        }
            
    }

    class Robot
    {        
        Position point = new Position(ConsoleKeyExample.xRobotStartPosition, ConsoleKeyExample.yRobotStartPosition);

        public void GoUp() {
            Console.SetCursorPosition(point.X, point.Y);
            Console.Write(" ");
            --point.Y;
        }
        public void GoDown() {
            Console.SetCursorPosition(point.X, point.Y);
            Console.Write(" "); 
            ++point.Y;
        }
        public void GoLeft() {
            Console.SetCursorPosition(point.X, point.Y);
            Console.Write(" "); 
            --point.X;
        }
        public void GoRight() {
            Console.SetCursorPosition(point.X, point.Y);
            Console.Write(" "); 
            ++point.X;
        }

        public void DrawRobot()
        {
       //     for (int j = 0; j < point.Y; j++)
         //   {
                Field.WriteAt("0", point.X, point.Y);
           // }
     //       for (int i = 0; i < point.X; i++)
       //     {
                Field.WriteAt("0", point.X, point.Y);
         //   }
        }
    }
}
